‫So the HTML5 Web storage feature, it has two objects.
‫These are local storage and sessions, storage objects.
‫Now, this feature is supported in all major modern browsers like Firefox, Chrome and all the others.
‫And be where we're going to exploit a local storage object.
‫OK, so this feature, local storage, it lets Web applications store data locally on the user's browser.
‫And then this data is in key value format, so you can think of it like cookies, but the data stored
‫in the local storage isn't sent to the Web server as opposed, you know, like cookies.
‫And that's what makes it faster and so much better than cookies.
‫So many developers prefer to use a local or session storage to hold sensitive data about local storage
‫is no more secure than cookies are.
‫In fact, the data in local storage objects can be stored for weeks, even years, and also Web storage
‫or what we're actually calling local storage, is origin specific.
‫So all pages from one origin can store and access the same data.
‫So go to Cali and open, be web, choose HTML five Web storage from the drop down menu.
‫Hey, it's nothing but a simple page.
‫And also, the page advises how to grab local storage data.
‫OK, so now open the web developer tool.
‫Go to the storage tab.
‫Open local storage node, and here is the data in key value form.
‫So this is our data in our browser.
‫Where's the problem, you ask?
‫Or is it just risky coding behavior?
‫Well, it depends on your point of view, the data in local storage is stored in a computer.
‫A local storage object stores the data with no expiration date, so the data will not be deleted when
‫the browser is closed and it will be available the next week, day, year, whatever month doesn't matter.
‫So somehow if someone were to gain access to the computer, they can easily extract this data, don't
‫you think?
‫And now another problem is an excess attack.
‫So if the application has access as vulnerability, this data is also in danger.
‫All right, so let's close up the developer tool and view the page source.
‫Now, I'm going to zoom in for you, so looky here, there is the JavaScript code right here and this
‫adds data to the local storage.
‫So let's scroll down a little bit.
‫Maybe we'll see something suspicious.
‫No, I don't see anything.
‫Anyway, to exploit and gather data from local storage, we will need an access vulnerability.
‫And guess what?
‫Thankfully, we have dozens of them, so go to excess as underscore, get that BHP.
‫So this page is vulnerable to excess.
‫And for a quick validation, that's just type your the famous payload script, alert document, cookie
‫script and then go.
‫Well, it really has, right?
‫OK, so we can view the content of the local storage in an alert message.
‫But, of course, I prefer to send it to our kooky Steeler application.
‫So I'm going to use this payload.
‫It's copy it.
‫And over the web developer tool.
‫And go to network tab.
‫Now, paste it here and then go.
‫All right, so here are the requests it sends the data to our STIHLER app.
‫Now go to our Steeler app, refresh.
‫And we have one session.
‫OK, so log into the application.
‫And look at the first line.
‫It is not a recession, but it is the data in the local storage of the target by the boom.